<div class="main-content">
        <!-- Content Header (Page header) -->
        <div class="breadcrumbs" id="breadcrumbs">
        	<script type="text/javascript">
				try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
			</script>
			<ul class="breadcrumb">
				<li>
					<i class="icon-home home-icon"></i>
					<a href="#">系统首页</a>
				</li>
	
				<li>
					<a href="#">系统管理</a>
				</li>
				<li>
					<a href="#">数据字典</a>
				</li>
				<li class="active">编辑数据字典</li>
			</ul><!-- .breadcrumb -->
        </div>
        <div class="page-content">
            <div class="row">
            <div class="page-header">
				<h1>编辑数据字典</h1>
			</div>
			<div class="col-xs-12">
			<?php if (validation_errors()!=''){?>
	           <div id="info_msg" class="alert alert-danger"><?php echo validation_errors();?></div>
	        <?php }?>
	            <!-- general form elements disabled -->
	            <form id="usrform" role="form" action="<?php echo base_url().'admin/systems/edit_dictionary_data/'.$dictionary_data->id;?>" method="post">
	                   <input name="data_id" value="<?php if (isset($dictionary_data->id)) echo $dictionary_data->id; ?>" type="hidden"  />
	                	<div class="box-body" style="display: inline-block;width: 100%">
	                        <div class="form-group col-xs-6">
	                            <label>项目名称</label>
	                            <input name="name" type="text" class="form-control" placeholder="输入 ..." value="<?php if (validation_errors()!='')echo set_value('name');elseif (isset($dictionary_data->name))echo $dictionary_data->name;?>" check-type="required">
	                        </div>
	                        <div class="form-group col-xs-6">
	                            <label>项目值</label>
	                            <input name="value" type="text" class="form-control" placeholder="输入 ..." value="<?php if (validation_errors()!='')echo set_value('value');elseif (isset($dictionary_data->value))echo $dictionary_data->value;?>" check-type="required number">
	                        </div>
	                        <div class="form-group col-xs-6">
	                            <label>数据字典</label>
	                            <select name="dictionary_id" class="form-control" check-type="required">
	                            	<option value="">请选择数据字典</option>
	                            	<?php if (isset($dictionary)&&count($dictionary)>0){
		                            	foreach ($dictionary as $val){?>
		                            <option value="<?php echo $val->id?>" <?php if (isset($dictionary_data->dictionary_id)&&$val->id==$dictionary_data->dictionary_id){?>selected<?php }?>><?php echo $val->name?></option>
		                            <?php }
		                            	}?>
	                            </select>
	                        </div>
	                        <div class="form-group col-xs-6">
	                            <label>备注</label>
	                            <input name="note" type="text" class="form-control" placeholder="输入 ..." value="<?php if (validation_errors()!='')echo set_value('note');elseif (isset($dictionary_data->note))echo $dictionary_data->note;?>">
	                        </div>
	                        
	                	</div><!-- /.box-body -->
	                	<div class="clearfix form-actions">
						<div class="col-md-offset-3 col-md-9">
							<button id="btnSubmit" class="btn btn-info" type="submit">
								<i class="icon-ok bigger-110"></i>
								保存
							</button>

							&nbsp; &nbsp; &nbsp;
							<a class="btn" href="<?php echo base_url()."admin/systems/query_data?id=$dictionary_data->dictionary_id"?>">
								<i class="icon-undo bigger-110"></i>
								返回
							</a>
						</div>
					</div>
	                </form>
                </div>
    		</div>
        </div>
    </div>
    <script type="text/javascript">
	$("#usrform").validation();
	//保存
	$("#btnSubmit").on('click',function(event){
	  // 2.最后要调用 valid()方法。
	  if ($("#usrform").valid()==false){
	    return false;
	  }
	});
	</script>
